<?php
/**
*
 * 版权所有：河南常新宏达网络科技<www.hncxhd.com>
 * 作    者：zxl
 * 日    期：2017-2-10
 * 版    本：1.0.0
* 功能说明：后台首页控制器。
*
**/

namespace Admin\Controller;
use Admin\Controller\ComController;
use Think\Auth;
class KsmanageController extends ComController {
    
    public function index(){
		
		$id = intval($id);
		$p = isset($_GET['p'])?intval($_GET['p']):'1';
		$ksxx = M('ksxx',"dz_");
		$pagesize =100;#每页数量
		$offset = $pagesize*($p-1);//计算记录偏移量
		$count = $ksxx->count();
		$list  = $ksxx->order('ksh desc')->limit($offset.','.$pagesize)->select();
		$page = new \Think\Page($count,$pagesize); 
		$page = $page->show();
        $this->assign('list',$list);	
        $this->assign('page',$page);
        $this->assign("recorders",$count);
         $this->assign("pagesize",$pagesize);
		$this -> display();
	}

	public function showinfo(){
		$id   = intval($id);
		$ksid = isset($_GET['id'])?intval($_GET['id']):'1';
	    $ksinfo = M('ksxx',"dz_")->where('id='.$ksid)->find();
	    $kszs=count( M('ksxx',"dz_")->select());
		$this->assign('ksinfo',$ksinfo);
		$this->assign('kszs',$kszs);
		$this -> display();
	}
}